<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>登陆</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		
		<link rel="stylesheet" href="__TMPL__/public/assets1/css/mui.min.css" />
		<link rel="stylesheet" href="__TMPL__/public/assets1/css/style.css" />
		<script type="text/javascript" src="__TMPL__/public/assets1/js/jquery.1.9.1.js" ></script>
		<script type="text/javascript" src="__TMPL__/public/assets1/js/rem.js" ></script>
		
		<script>
			window.onload = function() { 
				$(".load").removeClass("load"); 
			}; 
		</script>
	</head>
	<body>
		<!--加载遮罩-->
		<div class="load"></div>
		
		<div class="index">
			<div class="title">
				<h2>登陆</h2>
			</div>
			<div class="t-zw"></div>
			
			<div class="login-m">
				<div class="lm-logo"><img src="__TMPL__/public/assets1/img/logo.png" alt=""/></div>
				<div class="lm-form">
					<div class="lm-col"><input type="text" id="username" name="username" placeholder="请输入用户名" value="{$username}" /></div>
					<div class="lm-col lm-paswd"><input type="password" id="password" name="password" placeholder="请输入密码" value="{$password}" /></div>
					<div class="mui-input-row mui-checkbox mui-left lm-checkbox">
						<label>记住账号密码</label>
						<input name="checkbox" id="remember" name="remember" value="1" type="checkbox" checked>
						<!-- <input name="checkbox" value="Item 1" type="checkbox" checked> -->
					</div>
					
					<div class="lm-btn">
						<button type="button" id="button" class="mui-btn">登陆后台</button>
					</div>
				</div>
			</div>
		</div>
		
		
		<script type="text/javascript" src="__TMPL__/public/assets1/js/mui.min.js" ></script>
		<script type="text/javascript" src="__TMPL__/public/assets1/js/public.js" ></script>
		<script>
			mui('.mui-checkbox').on('change', 'input', function() {
				var value = this.checked?"1":"0";
				if (value == "1") {
					$('#remember').val(1);
				}else{
					$('#remember').val(0);
				}

				 
			});
		</script>

		
		<script type="text/javascript">
			$(function(){

				$("#button").click(function() {
					var username = $("#username").val();
					var password = $("#password").val();
					var remember = $("#remember").val();
					$.ajax({
						type: "post",
						url: "{:url('login/chake')}",
						async:false,
						data: {
							'username':username,
							'password':password,
							'remember':remember
						},
						
						success: function(data) {
							if (data.code == 1) {
								alert(data.msg);
							 window.location.href = '/home/index/index';
							}else{
								alert(data.msg);
								location.reload(true);
							 }
						}
					});

				})
			})

		</script>
	</body>
</html>
